import service from "@/utils/service";

// 获取维修单列表
export const getRepairOrderListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/page",
    method: "post",
    data
  });
};

// 开维修单
export const openRepairOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/billing",
    method: "post",
    data
  });
};

// 编辑维修单
export const editRepairOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/update",
    method: "post",
    data
  });
};

// 获取检查项列表
export const getExaminePageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairPrecheckItem/page",
    method: "post",
    data
  });
};
// 获取检查项列表-不分页
export const getExamineListApi = () => {
  return service({
    url: "/xiechetong/xctRepairPrecheckItem/list",
    method: "get"
  });
};

// 新增检查项
export const addExamineApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairPrecheckItem/add",
    method: "put",
    data
  });
};

// 编辑检查项
export const editExamineApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairPrecheckItem/update",
    method: "post",
    data
  });
};

// 删除检查项
export const deleteExamineApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairPrecheckItem/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
// 维修单查询外观内饰检查项目
export const getExamineInfoApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrderPrecheck/list",
    method: "post",
    data
  });
};

// 维修单添加外观内饰检检查项目
export const addExamineInfoApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/add-precheck",
    method: "post",
    data
  });
};

// 维修单添加服务项目和配件
export const addProjectAccessoryApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/add-project",
    method: "post",
    data
  });
};

// 获取维修单服务项目和配件
export const getProjectAccessoryInfoApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/get-project-list",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 维修单完工
export const finishRepairOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/order-finished",
    method: "post",
    data
  });
};

// 维修单取车
export const getCarRepairOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/order-pick-up-car",
    method: "post",
    data
  });
};

// 维修单作废
export const cancelRepairOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/order-cancellation",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 维修单结算
export const payRepairOrderApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/order-account",
    method: "post",
    data
  });
};
